package com.ytf.test.third;

/**
 * @author: YTF
 * @date: 2024/9/13 16:13
 * @version: 1.0
 * @description: spring 的 + +=
 */
public class StringOperators {
    public static void main(String[] args) {
        int x = 0, y = 1, z = 2;
        String s = "x ,y ,z ";
        System.out.println(s + x + y + z);
        System.out.println(x + "" + s); // Converts x to a String
        s+="(summed) =";// Concatenation operator
        System.out.println(s+(x+y+z));
        System.out.println(""+x); // Shorthand for Integer.toString()
        /**
         * Output:
         * x ,y ,z 012
         * 0x ,y ,z
         * x ,y ,z (summed) =3
         * 0
         * 总结
         *  字符串使用加号不会运算而是直接拼接
         */
    }
}
